package com.gec.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gec.model.system.ITripArea;
import com.gec.model.system.ITripSpace;
import com.gec.model.vo.ITripSpaceVo;
import com.gec.system.mapper.ITripSpaceMapper;
import com.gec.system.service.ITripSpaceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author dafei
 * @since 2024-01-24
 */
@Service
public class ITripSpaceServiceImpl extends ServiceImpl<ITripSpaceMapper, ITripSpace> implements ITripSpaceService {

    @Override
    public List<ITripSpace> getByUserId(Long userId) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("userId",userId);//相当于where userId=1
        List<ITripSpace> list = baseMapper.selectList(wrapper);
        return list;

    }

    @Override
    public IPage<ITripSpace> selectPage(IPage<ITripSpace> p1, ITripSpaceVo iTripSpaceVo) {
        IPage<ITripSpace> iPage = this.baseMapper.selectPage(p1, iTripSpaceVo, null);
        return iPage;
    }
}
